<template>
	<view class="container">
		<view class="kuang">
			<image class="bj" src="/static/图层 1@3x.png" mode=""></image>
			<view class="nav-bar">
				<view class="nav-left" @click="goBack">
					<uni-icons type="left" size="20" color="#ffffff"></uni-icons>
				</view>
				<text class="title">输入核销码</text>
				<view class="nav-right">
					<view>
						<uni-icons type="more-filled" size="22" color="#ffffff"></uni-icons>
					</view>
					<text class="nav-separator">|</text>
					<view>
						<uni-icons type="location-filled" size="22" color="#ffffff"></uni-icons>
					</view>
				</view>
			</view>
			<!-- 搜索栏 -->
			<view class="search-section">
				<view class="search-bar">
					<input class="search-input" v-model="verifyCode" placeholder="输入核销码" placeholder-style="color: #999;" />
					<view class="identify-btn" @click="handleIdentify">
						<text>识别</text>
					</view>
				</view>
			</view>
		</view>

		<!-- 内容卡片 -->
		<view class="content-container">
			<!-- 核销码显示 -->
			<view class="code-display">
				<text class="code-label">核销码</text>
				<text class="code-value">{{ verifyCode || 'MC1234-5678-9012' }}</text>
			</view>

			<!-- 服务内容 -->
			<view class="section">
				<view class="section-title">服务内容</view>
				<view class="service-content">
					<text class="service-title">XXX标准洗车服务包含</text>
					<view class="service-list">
						<text class="service-item">整车泡沫冲洗擦T</text>
						<text class="service-item">轮胎轮毅冲洗清洁</text>
						<text class="service-item">车内吸尘</text>
						<text class="service-item">内饰脚垫简单除尘</text>
					</view>
					<text class="service-note">(不包含虫户、水泥、沥青和顽固污渍清理等)</text>
				</view>
			</view>

			<!-- 订单信息 -->
			<view class="section">
				<view class="section-title">订单信息</view>
				<view class="order-info">
					<view class="info-item">
						<text class="info-label">订单价格:</text>
						<text class="info-value">¥30.00</text>
					</view>
					<view class="info-item">
						<text class="info-label">实付金额:</text>
						<text class="info-value highlight">¥25.00</text>
					</view>
					<view class="info-item">
						<text class="info-label">优惠金额:</text>
						<text class="info-value">¥5.00</text>
					</view>
					<view class="info-item">
						<text class="info-label">订单编号</text>
						<text class="info-value">2020032554565799</text>
					</view>
					<view class="info-item">
						<text class="info-label">支付时间</text>
						<text class="info-value">2020.03.30 14:40:45</text>
					</view>
					<view class="info-item">
						<text class="info-label">预约时间</text>
						<text class="info-value">2020.03.30 14:40</text>
					</view>
				</view>
			</view>

			<!-- 已核销按钮 -->
			<view class="bottom-btn">
				<button class="verified-btn" disabled>已核销</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				verifyCode: 'MC1234-5678-9012'
			}
		},
		onLoad(options) {
			if (options.code) {
				this.verifyCode = options.code
			}
		},
		methods: {
			goBack() {
				uni.navigateBack()
			},
			handleIdentify() {
				// 识别逻辑
				uni.showToast({
					title: '识别功能',
					icon: 'none'
				})
			}
		}
	}
</script>

<style scoped>
	.container {
		min-height: 100vh;
		width: 100%;
		position: relative;
		background-color: #f5f5f5;
	}

	.bj {
		position: absolute;
		z-index: 1;
		width: 750rpx;
		height: 430rpx;
		left: 0;
		top: 0;
	}

	.kuang {
		display: flex;
		flex-direction: column;
		position: relative;
		width: 100%;
		height: 430rpx;
	}

	.nav-bar {
		position: relative;
		z-index: 2;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 20rpx 30rpx;
		margin-top: 60rpx;
		height: 88rpx;
		box-sizing: border-box;
	}

	.nav-left {
		width: 40rpx;
		height: 40rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: white;
		font-weight: bold;
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
	}

	.nav-right {
		display: flex;
		align-items: center;
	}

	.nav-right > view {
		margin-right: 10rpx;
	}

	.nav-right > view:last-child {
		margin-right: 0;
	}

	.nav-separator {
		color: rgba(255, 255, 255, 0.5);
		font-size: 20rpx;
		margin: 0 8rpx;
	}

	/* 搜索区域 */
	.search-section {
		position: relative;
		z-index: 2;
		padding: 20rpx 30rpx;
		margin-top: 20rpx;
	}

	.search-bar {
		display: flex;
		align-items: center;
		background-color: #ffffff;
		border-radius: 50rpx;
		padding: 20rpx 24rpx;
		overflow: hidden;
	}

	.search-input {
		flex: 1;
		font-size: 28rpx;
		color: #333;
		background-color: transparent;
		margin-right: 20rpx;
	}


	.identify-btn {
		background-color: #007AFF;
		border-radius: 40rpx;
		padding: 12rpx 30rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.identify-btn text {
		color: #ffffff;
		font-size: 28rpx;
		font-weight: 500;
	}

	/* 内容容器 */
	.content-container {
		position: absolute;
		z-index: 2;
		top: 300rpx;
		left: 20rpx;
		right: 20rpx;
		bottom: 0;
		background-color: white;
		border-radius: 30rpx 30rpx 0 0;
		padding: 30rpx;
		padding-bottom: 40rpx;
		box-sizing: border-box;
	}

	/* 核销码显示 */
	.code-display {
		margin-bottom: 40rpx;
		padding-bottom: 30rpx;
		border-bottom: 1rpx solid #f0f0f0;
	}

	.code-label {
		font-size: 28rpx;
		color: #333;
		display: block;
		margin-bottom: 16rpx;
	}

	.code-value {
		font-size: 40rpx;
		font-weight: bold;
		color: #333;
		display: block;
	}

	/* 章节 */
	.section {
		margin-bottom: 40rpx;
	}

	.section-title {
		font-size: 32rpx;
		font-weight: bold;
		color: #333;
		margin-bottom: 24rpx;
	}

	/* 服务内容 */
	.service-content {
		font-size: 28rpx;
		color: #333;
		line-height: 1.8;
	}

	.service-title {
		display: block;
		margin-bottom: 20rpx;
		color: #333;
	}

	.service-list {
		margin: 20rpx 0;
	}

	.service-item {
		display: block;
		margin-bottom: 16rpx;
		color: #333;
		padding-left: 20rpx;
		position: relative;
	}

	.service-item::before {
		content: '•';
		position: absolute;
		left: 0;
		color: #333;
	}

	.service-note {
		display: block;
		margin-top: 20rpx;
		color: #999;
		font-size: 24rpx;
		line-height: 1.6;
	}

	/* 订单信息 */
	.order-info {
		font-size: 28rpx;
		color: #333;
	}

	.info-item {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 24rpx;
	}

	.info-item:last-child {
		margin-bottom: 0;
	}

	.info-label {
		color: #666;
		font-size: 28rpx;
	}

	.info-value {
		color: #333;
		font-size: 28rpx;
	}

	.info-value.highlight {
		font-weight: bold;
		color: #333;
	}

	/* 底部按钮 */
	.bottom-btn {
		margin-top: 40rpx;
		padding-top: 30rpx;
		border-top: 1rpx solid #f0f0f0;
	}

	.verified-btn {
		width: 100%;
		background-color: #cccccc;
		color: #ffffff;
		border-radius: 8rpx;
		padding: 28rpx 0;
		font-size: 32rpx;
		font-weight: 500;
		border: none;
	}
</style>
